{% extends "base.html" %}
{% block title %}Seznam prijavljenih na izpit{% endblock %}

{% block js %}

<script type="text/javascript">

$(document).ready(function(){
  $("#id_exam").change(function(){
    selected_value = $('#id_exam option:selected').val();
    if (selected_value != undefined && selected_value != "") {
      document.location="/exams/exam_list/{{professor.pk}}/"+selected_value+"/";
    }
  });
  })

</script>
{% endblock %}

{% block content %}
{% if only_search %}

<script type="text/javascript" src="{{ MEDIA_URL }}js/search.js"></script>
<script type="text/javascript">

$(document).ready(function(){    
    search_setcb('professor',function(professor){
      url = '/exams/exam_list/'+professor.pk+'/';
      document.location = url;
    });
    
});
</script>
{% include "snippets/professor/search.htm" %}
{% else %}
<p class="hide_print">
  <b>Izbrani profesor: </b> {{ professor }}<br />
  <a href="/exams/exam_list/">Ponovna izbira profesorja</a>
</p><br />
<div class="form">
  {{ form.as_p }}
</div>
{% if data != None %}
{% include "snippets/core/print.htm" %}

<h2>Seznam prijavljenih na izpit</h2>
<p><b>seznam prijavljenih za izpit: </b> {{ exam }}</p>
<p><b>Izvajalci: </b> {{ exam.show_professor }} </p>
<p style="text-align: right">

<table class="list" style="width: 90%">
  <tr>
    <th class="num">#</th>
    <th>Vpisna številka</th>
	<th>Priimek in ime</th>
	<th>Št. polaganj</th>
    <th>Študijsko leto</th>
	<th>Plačilo</th>
  </tr>
  {% for student in data %}
  <tr>
	<td class="num">{{ forloop.counter }}</td>
	<td>{{ student.student.enrollment_number }}</td>
	<td>{{ student.student.user.last_name }} {{ student.student.user.first_name }}</td>
	<td>{{ student.num_app }}</td>
	<td>{{ student.student.latest_enrollment_sheet.academic_year }}</td>
	<td>
		{% if student.paid %}
		<b>Da</b>
		{% endif %}
	</td>
	</td>
  </tr>
  {% endfor %}
</table>
</p>
{% endif %}
{% endif %}
{% endblock %}